<?php

require_once 'lib/include/Include.php';

LoggerFactory::init('logs/log.txt', LoggerFactory::$all);

$logger = LoggerFactory::getLogger('FrontController');
$logger->info('FronController started');

Context::init('config/config.xml');
Context::init('lib/config/framework-config.xml');

$requestURI = $_SERVER['REQUEST_URI'];
$test = Context::resourceFromURI($requestURI);

if ($test == NULL) {
	$logger->debug('Null resource!');
} else {
	$test->dispatch();
}

$logger->info('FronController stopping...');
LoggerFactory::close();

?>